﻿using System;
using System.Linq;

using Fuse8.DomainFramework.Domain;

using Fuse8.ContentManagementFramework.Domain.Special;
using Fuse8.ContentManagementFramework.Domain.Commands.CommandParameters;
using Fuse8.ContentManagementFramework.SystemFacade.Extensions;

namespace Fuse8.ContentManagementFramework.Domain.Commands
{
    public abstract class CmsUserAssignToGroupsCommand : BaseEntityParameterCommand<CmsUserInformation, CmsUserAssignToGroupsCommandParameter>
    {
        public override string CacheKey
        {
            get 
            {
                return string.Format("UserId_{0};UserGroups_{1}",
                    CommandParameter.UserId,
                    CommandParameter.UserGroupIds.Select(p => p.ToString()).ToPlainString());
            }
        }

        public override string CommandName
        {
            get 
            {
                return "CmsUserAssignToGroupsCommand";
            }
        }
    }
}
